<?php 
header("content-type:text/html;charset=utf-8");
$db=new PDO("mysql:host=127.0.0.1;dbname=zice;charset=utf8",'root','root');
$redis=new Redis();
$redis->connect("127.0.0.1","6379");
$id=$_GET['id'];
$sql="select * from good where id=$id";
$data=$db->query($sql)->fetch();
if($redis->get("visit".$id)){
	$redis->incr("visit".$id);
	$visit=$redis->get("visit".$id);
}else{
	$redis->set("visit".$id,1);
	$visit=$redis->get("visit".$id);
}












 ?>
 <!DOCTYPE html>
 <html>
 <head>
 	<title>详情</title>
 </head>
 <body>
 <center>
 	这是你第<?php echo $visit; ?>次访问
 	<?php echo $data['name'] ?>
 </center>
 </body>
 </html>